Skip to content

feat(elements): Add backup_code verification strategy - #3627

Merged
tmilewski merged 3 commits into
mainfrom
tm.feat/elements-backup-code-strategy
Jul 1, 2024
Merged

feat(elements): Add backup_code verification strategy#3627
tmilewski merged 3 commits into
mainfrom
tm.feat/elements-backup-code-strategy

Conversation

@tmilewski

Copy link
Copy Markdown
Member

Description

Adds backup_code verification strategy

<SignIn.Step name='choose-strategy'>
  <SignIn.SupportedStrategy name='backup_code'>Use a backup code</SignIn.SupportedStrategy>
<SignIn.Step>
<SignIn.Step name='verifications'>
  <SignIn.Strategy name='backup_code'>
    <Clerk.Field name="backup_code">
      <Clerk.Label>Code:</Clerk.Label>
      <Clerk.Input />
      <Clerk.FieldError />
    </Clerk.Field>

    <Clerk.Action submit>Continue</Clerk.Action>
  </SignIn.Strategy>
<SignIn.Step>

Fixes SDK-1852

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@tmilewski tmilewski self-assigned this Jun 26, 2024
@changeset-bot

changeset-bot Bot commented Jun 26, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 69b3384

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@clerk/elements Minor
@clerk/ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

setConsoleError: ({ event }) => {
if (process.env.NODE_ENV === 'development') {
assertActorEventError(event);
if (process.env.NODE_ENV !== 'development') {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed throw as it puts users into a completely irrecoverable state even if FieldError or GlobalError are present.

};
}
if (type === 'password' && shouldValidatePassword) {
} else if (type === 'backup_code') {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code name has a number of predefined assumptions which don't work for backup codes.

The backup_code name circumvents those assumptions while still maintaining the required field name of code.

@tmilewski

Copy link
Copy Markdown
Member Author

!snapshot

@clerk-cookie

Copy link
Copy Markdown
Collaborator

Hey @tmilewski - the snapshot version command generated the following package versions:

Package Version
@clerk/chrome-extension 1.1.1-snapshot.v64cb67f
@clerk/clerk-js 5.7.3-snapshot.v64cb67f
@clerk/elements 0.10.0-snapshot.v64cb67f
@clerk/clerk-expo 1.2.4-snapshot.v64cb67f
gatsby-plugin-clerk 5.0.0-beta.45
@clerk/ui 0.1.5-snapshot.v64cb67f

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/chrome-extension

npm i @clerk/chrome-extension@1.1.1-snapshot.v64cb67f --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.7.3-snapshot.v64cb67f --save-exact

@clerk/elements

npm i @clerk/elements@0.10.0-snapshot.v64cb67f --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@1.2.4-snapshot.v64cb67f --save-exact

gatsby-plugin-clerk

npm i gatsby-plugin-clerk@5.0.0-beta.45 --save-exact

@clerk/ui

npm i @clerk/ui@0.1.5-snapshot.v64cb67f --save-exact

@tmilewski
tmilewski requested review from a team and alexcarpenter June 27, 2024 19:16
@tmilewski
tmilewski enabled auto-merge (squash) July 1, 2024 13:35
@tmilewski
tmilewski merged commit c09a0af into main Jul 1, 2024
@tmilewski
tmilewski deleted the tm.feat/elements-backup-code-strategy branch July 1, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants